import {
  SET_BANNER,
  SET_RECOMMEND
} from './constants.js'

//拆分homeReducer
const homeInitialState = {
  banners: [],
  recommends: []
}
function homeReducer(state = homeInitialState, action) {
  switch(action.type) {
    case SET_BANNER:
      return {...state, banners: action.list}
    case SET_RECOMMEND:
      return {...state, recommends: action.list}
    default:
      return state
  }
}

export default homeReducer